home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / faq / kjvcbibl.lha / cbible / rexx / dbtest.rexx < prev    next >
OS/2 REXX Batch file  |  1993-03-18  |  2KB  |  46 lines

  1. /*******************************************************************
  2.   ARexx program to illustrate the use of THINKER as a database
  3. ********************************************************************/
  4.  
  5. /*  OPTIONS RESULTS is needed because THINKER returns result strings */
  6.  
  7. options results
  8. address command
  9.  
  10. /*   Start THINKER with NO default file and NO window */
  11.  
  12. 'run >NIL: thinker:thinker -now'
  13.  
  14. /*    THINKER takes a while to load  */
  15.  
  16. 'wait 15 sec'
  17. WaitForPort 'Thinker' 
  18.  
  19. /*  Switch the Host to THINKER for the next commands */
  20.  
  21. address 'Thinker'
  22.     
  23. /*  The next commands are commented on the right */
  24.  
  25. create 'thinker:db1'                      /* create a database */
  26. get origin 'thinker:db1'                  /* set the default file */
  27. add origin '(software) Computer Programs' /* ORIGIN is a place to add */
  28. add origin '(computer) Calculating machines'
  29. add after down 'The Amiga is an example'  /* add a subordinate statement */
  30. add origin '(programs) Detailed instructions'
  31. add origin '(programs) Long range plans'
  32. get label first programs                  /* get first instance of label */
  33. if rc = 0 then say result
  34. get label next                            /* get next instance of label */
  35. if rc = 0 then say result
  36. get succeeding                     /* get next statement at same level */
  37. if rc = 0 then say result
  38. get label first computer           /* get first instance of label */
  39. get down                           /* get subordinate statement */
  40. if rc = 0 then say result
  41. get up                             /* get parent statement */
  42. if rc = 0 then say result
  43. get preceding                    /* get previous statement at same level */
  44. if rc = 0 then say result
  45. close                            /* terminate THINKER and save file */
  46.